/**
 * Project Name: true-license
 * File Name: LicenseCreatorController
 * Package Name: com.example.demo.controller
 * Date: 2020/10/10 13:36
 * Author: 方瑞冬
 */
package com.wizz.trade.license.controller;


import com.wizz.trade.common.annotation.Public;
import com.wizz.trade.license.licenseConfig.LicenseCheckModel;
import com.wizz.trade.license.licenseConfig.LicenseCreatorParam;
import com.wizz.trade.license.service.LicenseCreatorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * 软件正版化
 *
 * @author xialinrui
 * @ignore
 */
@RestController
@RequestMapping("/license")
public class LicenseCreatorController {
    @Resource
    private LicenseCreatorService licenseCreatorService;

    /**
     * 获取待激活设备硬件信息
     *
     * @param osName 系统名称
     * @author xialinrui
     */

    @GetMapping("/info")
    public LicenseCheckModel getServerInfos(@RequestParam String osName) {

        return licenseCreatorService.getServerInfos(osName);
    }

    /**
     * 创建证书
     * @param param 证书创建参数
     * @author xialinrui
     */

    @PostMapping("/generateLicense")
    public Map<String, Object> generateLicense(@RequestBody LicenseCreatorParam param) {
        return licenseCreatorService.generateLicense(param);
    }
}
